package org.noworks.game;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.geom.Vector2f;
import org.newdawn.slick.state.StateBasedGame;
import org.noworks.game.engine.Component;

/**
 * Component to handle gravity for an entity in a side scrolling senario.
 * 
 * @author Michael Nowak
 * 
 */
public class SideScrollGravity extends Component {

	private float grav = 0; // Gravity to be used
	private boolean staticGravity = true; // Changes type of gravity. Static is
											// just a generic down X position,
											// Non-static is not implemented
											// yet, but will work as an
											// accelerant.

	/**
	 * @param id
	 *            ID of the Entity
	 * @param grav
	 *            Gravity to set for the Entity
	 */
	public SideScrollGravity(String id, float grav) {
		this.id = id;
		this.grav = grav;
	}

	@Override
	public void update(GameContainer gc, StateBasedGame sbg, int delta) {
		if (staticGravity) {
			Vector2f p = owner.getPosition();
			p.y -= grav;
		} else {

		}
	}

}
